﻿@model Retete.ViewModels.InventarViewModel
@{
    ViewBag.Title = "Inventar";
}

<table style="width: 100%">
    <tr>
        <td style="width: 190px; vertical-align: top; border-right-style: dashed; border-right-color: #CFCFCF; border-right-width: 1px;">
            <fieldset>
                <legend>Activitati</legend>

                <p class="toolbox">@Html.ActionLink("Introducere stoc real", "Edit")</p>
                <p class="toolbox">@Html.ActionLink("Adaugare produs", "Create")</p>
                <p class="toolbox">@Html.ActionLink("Tiparire", "ExportExcel")</p>
            </fieldset>

            <fieldset>
                <legend>Selectare data</legend>

                <p>@Html.Calendar(DateTime.Today.AddMonths(-1).Year, DateTime.Today.AddMonths(-1).Month, Model.SelectedDate)</p>
                <p>@Html.Calendar(DateTime.Today.Year, DateTime.Today.Month, Model.SelectedDate)</p>
            </fieldset>
        </td>
        <td style="vertical-align: top;">
            <fieldset>
                <legend>@Model.Titlu</legend>

                <table class="grid">
                    <thead>
                        <tr>
                            <th style="width: 16px"></th>
                            <th style="width: 70px">Cod</th>
                            <th>Produs</th>
                            <th style="width: 100px">Categorie</th>
                            <th style="width: 65px">Unitate</th>
                            <th style="width: 100px">Pret cumparare</th>
                            <th style="width: 100px">Pret vanzare</th>
                            <th style="width: 139px">Cantitate</th>
                        </tr>
                    </thead>

                    @foreach (var item in Model.Stoc)
                    {
                        <tr>
                            <td>
                                <a href="@Url.Action("Delete", new { id = item.ID })">
                                    <img src="@Url.Content("~/Content/Images/Delete.png")" alt="Sterge" style="height: 12px; cursor: pointer;" />
                                </a>
                            </td>

                            <td>@item.Cod</td>
                            <td>@item.Nume</td>
                            <td>@item.Categorie</td>
                            <td>@item.UnitateMasura</td>
                            <td>@item.PretCumparare.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)</td>
                            <td>@item.Pret.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)</td>
                            <td>@item.Cantitate.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)</td>
                        </tr>
                    }
                </table>
            </fieldset>
        </td>
    </tr>
</table>